<!--#include file="classData.asp"-->
<%
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.AddHeader "Pragma", "No-Cache"



	CurrentGroup = Request.QueryString("CurrentGroup")
	SeasonNum = Request.QueryString("SeasonNum")
	gf = Request.QueryString("gf")
	gs = Request.QueryString("gs")

	Select Case CurrentGroup
	
		Case 65 'A
			gfId = "93101"
			gsId = "93109"
		Case 66 'B
			gfId = "93110"
			gsId = "93102"
		Case 67 'C
			gfId = "93103"
			gsId = "93111"
		Case 68 'D
			gfId = "93112"
			gsId = "93104"
		Case 69 'E
			gfId = "93105"
			gsId = "93113"
		Case 70 'F
			gfId = "93114"
			gsId = "93106"
		Case 71 'G
			gfId = "93107"
			gsId = "93115"
		Case 72 'H
			gfId = "93116"
			gsId = "93108"

	End Select





	set HuaObj = new sysData
	HuaObj.sqlConnOpen()
	
	HuaObj.p_DbConnection.BeginTrans
	on error resume next


	InsertSql = "UPDATE AreaCup SET ManagerId ="&gf&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 51 AND ManagerId = "&gfId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE AreaCup SET ManagerId ="&gs&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 51 AND ManagerId = "&gsId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE AreaCup SET IfDone = 1 WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 5 AND ManagerId = "&gf
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE AreaCup SET IfDone = 2 WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 5 AND ManagerId = "&gs
	HuaObj.SCommand(InsertSql)


	InsertSql = "UPDATE CupPlan SET HomeId ="&gf&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 51 AND HomeId = "&gfId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE CupPlan SET AwayId ="&gf&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 51 AND AwayId = "&gfId
	HuaObj.SCommand(InsertSql)


	InsertSql = "UPDATE CupPlan SET HomeId ="&gs&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 51 AND HomeId = "&gsId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE CupPlan SET AwayId ="&gs&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 51 AND AwayId = "&gsId
	HuaObj.SCommand(InsertSql)


	response.ContentType="text/xml"	
	Response.Write("<?xml version=""1.0"" encoding=""gb2312""?>"&vbcrlf)
	Response.Write("<xml>"&vbcrlf)


	if err.number =0 then  
    	HuaObj.p_DbConnection.CommitTrans  '如果没有conn错误，则执行事务提交
		Response.Write("<Shi ShiId = ""1"">"&vbcrlf)
		Response.Write("</Shi>"&vbcrlf)
	else 
    	HuaObj.p_DbConnection.RollbackTrans '否则回滚
		Response.Write("<Shi ShiId = ""0"">"&vbcrlf)
		Response.Write("</Shi>"&vbcrlf)
	end if

	Response.Write("</xml>"&vbcrlf)

	
	HuaObj.sqlConnClose()


%>
